<?php

class Recruiter_SearchController extends Zend_Controller_Action
{
	public function init()
	{
		
	}
	
	public function jobseekerAction()
	{
		$this->_helper->layout()->disableLayout();
		
		$model = new RP_Model_DbTable_Industry();
		$rowSet = $model->fetchAllIndustries();
		$this->view->assign('industrySet',$rowSet);
		
		$model = new RP_Model_DbTable_Course();
		$rowSet = $model->fetchAllCourses();
		$this->view->assign('courseSet',$rowSet);
	}
	
	public function fetchprofilesAction(){
		$this->_helper->layout()->disableLayout();
		$this->_helper->viewRenderer->setNoRender(true);
		$param = array();
		$request = $this->getRequest();
		
		if($request->getParam('industry_id') != 0){
			$param['industry_id'] = $request->getParam('industry_id');
			//array_push($param, $request->getParam('industry_id'));
		}
		if($request->getParam('course_id') != 0){
			$param['course_id']= $request->getParam('course_id');
			//array_push($param, $request->getParam('course_id'));
		}
		if($request->getParam('edu_spec_id') != 0){
			$param['edu_spec_id']= $request->getParam('edu_spec_id');
			//array_push($param, $request->getParam('edu_spec_id'));
		}
		if($request->getParam('course_type') != ""){
			$param['course_type'] = $request->getParam('course_type');
			//array_push($param, $request->getParam('course_type'));
		}
		$param['exp_min'] = $request->getParam('emin');
		$param['exp_max'] = $request->getParam('emax');
		
		Zend_Registry::get('logger')->debug($param);
		
		$model = new RP_Model_User_Jobseeker();
		$result = $model->fetchForSearch($param);
		$this->_helper->json($result);
		return;
	}
	
}